<!DOCTYPE html>  
<html xmlns:th="http://www.thymeleaf.org">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>工作计划</title>
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css" />
<script type="text/javascript" src="../js/jquery-2.1.4.js"></script>
<script type="text/javascript">
	$(function(){
		$(".deletehref").click(function(){
			if(confirm("确认删除")){
				$("#deleteForm").attr("action",$(this).attr("deleteurl")).submit();
			}
		})
	})
</script>
</head>
<body>
<div class="container" style="width: 100%;padding: 25px 15px;">
    <div class="row clearfix">
        <div class="col-md-12 column" style="padding: 20px;">
            <div style="float: left;">
                  <!-- <input type="button" class="btn btn-primary btn"  onclick="operation()" value="添加" /> -->
                  <form th:action="@{/workPlan/addWorkPlan}" method="get">
                  	<input type="submit" class="btn btn-primary btn" value="添加" />
                  </form>
            </div>
            <form th:action="@{/workPlan/getAllPageBean}" id="userForm" role="form" class="form-inline" style="float: right;margin-bottom: 10px;">
                <div class="form-group" style="margin-right: 20px;">
                     <label for="exampleInputEmail1" style="margin-right: 10px;">姓名</label><input type="text" class="form-control" id="realName" name="username" placeholder="姓名"/>
                </div>
                <button type="submit" class="btn btn-primary btn" >查询</button>
            </form>
            <table class="table table-bordered" style="margin-top: 20px;">
                <thead>
                    <tr>
                        <th style="width: 150px;">姓名</th>
                        <th>本周工作总结</th>
                        <th>本周遇到的问题</th>
                        <th>下周工作计划</th>
                        <th style="width: 150px;">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr class="success" th:each="workPlan:${pb.beanList}">
                        <td>[[${workPlan.employee.username}]]</td>
                        <td>[[${workPlan.w_summary}]]</td>
                        <td>[[${workPlan.w_problem}]]</td>
                        <td>[[${workPlan.w_plan}]]</td>
                        <td>
                           <a th:href="@{/workPlan/}+${workPlan.w_id}" class="btn btn-primary btn">修改</a>
                           <a href="#" th:attr="deleteurl=@{/workPlan/}+${workPlan.w_id}" class="btn btn-primary btn deletehref" >删除</a>
                        </td>
                    </tr>
                </tbody>
            </table>
            <span>[[${pb.totalRecored}]]条记录 共[[${pb.totalPage}]]页 当前第[[${pb.pageIndex}]]页</span>
			<!-- 分页 -->
			<ul class="pagination" style="float: right;margin: 0;">
				<li th:if="${pb.pageIndex > 1 }">
					<a th:href="@{${pb.url }+'&pageIndex=1'}">首页</a>
				</li>
				<li th:if="${pb.pageIndex > 1 }">
					<a th:href="@{${pb.url }+'&pageIndex='+${pb.pageIndex-1 }}">上一页</a>
				</li>
				<li th:if="${pb.pageIndex < pb.totalPage }">
					<a th:href="@{${pb.url }+'&pageIndex='+${pb.pageIndex+1 }}">下一页</a>
				</li>
				<li th:if="${pb.pageIndex < pb.totalPage }">
					<a th:href="@{${pb.url }+'&pageIndex='+${pb.totalPage }}">尾页</a>
				</li>
			</ul>
        </div>
    </div>
</div>
<form id="deleteForm" method="post">
	<input type="hidden" name="_method" value="delete"/>
</form>
</body>
<script type="text/javascript" src="../js/jquery-2.2.3.min.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
</html>